home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / text / manipulation / snap164.lha / rexx.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-30  |  1.0 KB  |  61 lines

  1. #if __SASC
  2. #include "snap.h"
  3. #endif
  4.  
  5. /* Auto: make
  6. */
  7.  
  8. #include "minrexx.h"
  9.  
  10. IMPORT struct SnapRsrc *SnapRsrc;
  11.  
  12. VOID    rexxprepend(struct RexxMsg *msg, char *p);
  13. VOID    rexxappend(struct RexxMsg *msg, char *p);
  14. int    disp(register struct RexxMsg * msg,
  15.          register struct rexxCommandList * dat,
  16.          char * p);
  17. VOID    pend(char * addr, char * p);
  18.  
  19. struct rexxCommandList rcl[] = {
  20.     { "prepend", (APTR)&rexxprepend },
  21.     { "append", (APTR)&rexxappend },
  22.     { NULL, NULL }
  23. };
  24.  
  25. char result[17];
  26.  
  27. int disp(msg, dat, p)
  28. register struct RexxMsg *msg ;
  29. register struct rexxCommandList *dat ;
  30. char *p ;
  31. {
  32.     result[0] = '\0';
  33.     ((int (*)())(dat->userdata))(msg, p) ;
  34.     replyRexxCmd(msg, 0L, 0L, &result[0]);
  35.     return 1;
  36. }
  37.  
  38. VOID pend(addr, p)
  39. char *addr;
  40. char *p;
  41. {
  42.     strcpy(&result[0], addr);
  43.     if (*p) {
  44.         strncpy(addr, p + 1, 16);
  45.     }
  46. }
  47.  
  48. VOID rexxprepend(msg, p)
  49. struct RexxMsg *msg ;
  50. char *p ;
  51. {
  52.     pend(&SnapRsrc->Prepend[0], p);
  53. }
  54.  
  55. VOID rexxappend(msg, p)
  56. struct RexxMsg *msg ;
  57. char *p ;
  58. {
  59.     pend(&SnapRsrc->Append[0], p);
  60. }
  61.